#ifndef _XSCSIUSB_INCLUDE_XSCSILIBUSB_H_
#define _XSCSIUSB_INCLUDE_XSCSILIBUSB_H_
#include "xconfig.h"
#include "xusb_common.h"
#include "xusbdevice.h"

XUDC_API_BEGIN

int APICALL x_scsi_libusb_enumdevice(int vid, int pid, TXUSBDevice deviceList[], int maxCout);

int APICALL x_scsi_libusb_searchdevice(unsigned short vid, unsigned short pid, char *szSerialNumber, PXUSBDevice deviceInfo);

void *APICALL x_scsi_libusb_opendevice(PXUSBDevice usbDevice);

int APICALL x_scsi_libusb_closedevice(void *handle);

#ifdef __ANDROID__
    void *APICALL x_scsi_libusb_opendevice_fd(int vid, int pid, int busNum, int dev_address, int fd);
    void *APICALL x_scsi_libusb_opendevice_usbhost(JavaVM *jvm, JNIEnv *env, jobject obj);
    int APICALL x_scsi_libusb_closedevice_usbhost(JavaVM *jvm, JNIEnv *env, void *handle);
#endif

#ifndef _WIN32
int APICALL x_scsi_libusb_controltransfer(void *handle, unsigned char bmRequestType, unsigned char bRequest, unsigned short wValue, unsigned short wIndex,
                                          unsigned char *data, unsigned short wLength, unsigned int timeout);
int APICALL x_scsi_libusb_transferwrite(void *handle, unsigned char *data, int length, int *transferred, unsigned int timeout);
int APICALL x_scsi_libusb_transferread(void *handle, unsigned char *data, int length, int *transferred, unsigned int timeout);

void APICALL x_scsi_libusb_resetdevice(void *handle);

int APICALL  x_scsi_libusb_getserial(void *handle, char *serial, int size);
int APICALL  x_scsi_libusb_getmodel(void *handle,  unsigned char *buffer, int size);
int APICALL  x_scsi_libusb_getmanufacturer(void *handle,  unsigned char *buffer, int size);
int APICALL  x_scsi_libusb_get_vid_pid_rev(void *handle, int *nVID, int *nPID, int *nREV);
#endif

XUDC_API_END

#endif